const webpack = require('webpack')
const { staticPath, resourcesPath } = require('../utils/pathVars')

module.exports = {
    mode: 'development',
    module: {
        rules: [
            {
                test: /\.node$/,
                use: 'node-loader'
            }
        ]
    },
    node: {
        __dirname: process.env.NODE_ENV !== 'production',
        __filename: process.env.NODE_ENV !== 'production'
    },
    output: {
        filename: '[name].js',
        libraryTarget: 'commonjs2'
    },
    plugins: [
        new webpack.DefinePlugin({
            'process.env.NODE_ENV': `"${process.env.NODE_ENV}"`,
            'process.env.MODE': `"${process.env.MODE}"`,
            '__static': staticPath,
            '__resources': resourcesPath
        }),
        
    ]
}